<%
# Code Review plugin for Redmine
# Copyright (C) 2009  Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-%>
<div class="code_review">
  
</div>
<div id="review-form-frame" style="position:absolute;display:none;top:0px" class="draggable">
  <div id="review-form">
  
  </div>
</div>

<% javascript_tag do %>
  var addReviewUrl = '<%= url_for :controller => 'code_review', :action => 'new', :id=>@project %>';
  var is_readonly = true;
  <% if authorize_for('code_review', 'new') -%>
    is_readonly = false;
  <% end %>
  setAddReviewButton(addReviewUrl, <%= @change.id %>, '<%= image_tag('edit.png', :alt => l(:label_add_review), :title => l(:label_add_review)) %>', is_readonly);

  showReviewUrl = '<%= url_for :controller => 'code_review', :action => 'show', :id=>@project %>';
  showReviewImageTag = '<%= image_tag('review.png', :plugin => 'redmine_code_review', :alt => l(:label_show_review), :title => l(:label_show_review)) %>';
  <% for review in @reviews do %>
    setShowReviewButton(<%= review.line %>, <%= review.id %>);
  <% end %>
  setDraggables();
  <% if @show_review_id -%>
  popupReview(<%= review.line %>, <%= @show_review_id %>);
  <% end -%>
<% end %>